#! /usr/bin/env python

class Wrapper(object):
    _ignore_read = []
    _ignore_write = []

    def __init__(self, obj):
        self.__dict__['_obj'] = obj

    def __getattr__(self, key):
        if key in self.__dict__:
            return self.__dict[key]
        elif key not in self._ignore_read:
            return getattr(self._obj, key)
        else:
            raise AttributeError, key

    def __setattr__(self, key, value):
        if key in self.__dict__:
            object.__setattr__(self, key, value)
        elif key not in self._ignore_write:
            setattr(self._obj, key, value)
        else:
            raise AttributeError, key

"""
class Profile(Wrapper):

    _ignore_read = ['password']
    _ignore_write = ['username']
    _remap_read = {'pname':'name'}
    _remap_write = {'pname':'name'}

    def __init__(self, username, password):
        row = ProfileTable(username, password)
        super(Wrapper, self).__init__(row)
"""


